package com.ruoyi.project.drug.service.impl;

import com.ruoyi.project.drug.domain.DruSupplier;
import com.ruoyi.project.drug.mapper.DruSupplierMapper;
import com.ruoyi.project.drug.service.DruSupplierService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DruSupplierServiceImpl implements DruSupplierService {


    @Autowired
    private DruSupplierMapper druSupplierMapper;



    /**
     * 根据条件查询供应商信息
     *
     * @param druSupplier  用于传送查询条件
     * @return  返回查询结果集合
     */
    @Override
    public List<DruSupplier> selectAll(DruSupplier druSupplier) {
        return druSupplierMapper.selectAll(druSupplier);
    }



    /**
     * 无条件查询所有供应商信息
     *
     * @return  返回查询结果集合
     */
    @Override
    public List<DruSupplier> selectSupplier() {
        return druSupplierMapper.selectSupplier();
    }


    /**
     * 添加供应商信息
     *
     * @param druSupplier  用来传递供应商数据信息
     * @return  返回 1 新增车工  否则失败
     */
    @Override
    public int addSupplier(DruSupplier druSupplier) {
        return druSupplierMapper.addSupplier(druSupplier);
    }



    /**
     * 根据主键查询单个的供应商信息
     *
     * @param dsid  供应商主键ID
     * @return  返回查询的单挑供应商信息
     */
    @Override
    public DruSupplier selectOne(int dsid) {
        return druSupplierMapper.selectOne(dsid);
    }



    /**
     * 修改供应商信息
     *
     * @param druSupplier  用来传递供应商数据信息
     * @return  返回 1 修改车工  否则失败
     */
    @Override
    public int updateSupplier(DruSupplier druSupplier) {
        return druSupplierMapper.updateSupplier(druSupplier);
    }


    /**
     * 根据主键ID删除单条或多条供应商信息
     *
     * @param dsids  供应商ID数组
     * @return  返回 1 删除车工  否则失败
     */
    @Override
    public int deleteSupplier(int[] dsids) {
        return druSupplierMapper.deleteSupplier(dsids);
    }
}
